package com.gitee.wsl.ext.array

fun DoubleArray.maxOrElse(nil: Double): Double {
    if (isEmpty()) return nil
    var out = Double.NEGATIVE_INFINITY
    for (i in 0..lastIndex) out = kotlin.math.max(out, this[i])
    return out
}